home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
PC World 2006 September
/
PCWorld_2006-09_cd.bin
/
v cisle
/
hexer
/
mpth_17.exe
/
{app}
/
scripts
/
Structure Viewer
/
fat32.mps
< prev
next >
Wrap
Text File
|
2006-03-19
|
5KB
|
181 lines
option title, "FAT32 Boot structure"
=
=
= Tiny Hexer script for FAT32 structure view in
= mirkes.de's tiny hex editor
=
= Adaptation of FAT16 (and built-in BMP) structure viewer
=
= 02-07-05 Bill Blankenship
=
option GlobalVars, 1
option ReadTags, 1
option target, structureviewer
= open active editor and goto current position/0
var editor file
editor = fileopen('::current')
if ((param_count > 0) and (dword(params(0))==1))
fileseek editor, 0
else
fileseek editor, filegetprop(editor, 'selstart')
endif
var start dword
start = filegetprop(editor, 'position')
= open browser window
var browser file
browser = fileopen('::browser', 'c')
filesetprop browser, 'accepttags', 1
filewrite browser "<font color=",'"',"blue",'"',"><b><u>FAT32 Boot structure:</u></b></font>\n\n"
filesetprop browser, 'accepttags', 0
filewrite browser "Position: ",start,"\n\n"
= read the JMP instruction
var JMP1 byte JMP2 byte NOP byte
fileread editor JMP1
fileread editor JMP2
fileread editor NOP
= print JMP Instruction
filewrite browser "JMP instruction: \t\t'",JMP1," ",JMP2," ",NOP,"'\n"
var OEM text
fileread editor OEM 8
filewrite browser "OEM: \t\t\t\t'",OEM,"'\n"
= Do BIOS Parameter block
var bytespersect word sectpercluster byte reservedsect word numfats byte
var rootentries word totalsectors word mediatype byte sectperfat word
var sectpertrack word numheads word hiddensect dword
var bigtotalsect dword bigsectperfat dword
var extflags word fsver word rootdirstartclus dword
var fsinfosec word backbootsect word
var res1 qword res2 dword biosdrive byte unused byte
var signature byte volsn dword volumelabel text sysid text
fileread editor bytespersect
filewrite browser "Bytes per Sector: \t\t'",bytespersect,"' ("
call TO_DEC @bytespersect
filewrite browser " dec)\n"
fileread editor sectpercluster
filewrite browser "Sectors per cluster: \t\t'",sectpercluster,"' ("
call TO_DEC @sectpercluster
filewrite browser " dec)\n"
fileread editor reservedsect
filewrite browser "Reserved Sectors: \t\t'",reservedsect,"' ("
call TO_DEC @reservedsect
filewrite browser " dec)\n"
fileread editor numfats
filewrite browser "Number of FATs: \t\t'",numfats,"'\n"
fileread editor rootentries
filewrite browser "Max root entries: \t\t'",rootentries,"' ("
call TO_DEC @rootentries
filewrite browser " dec)\n"
fileread editor totalsectors
filewrite browser "Total sectors (small volume): \t'",totalsectors,"' ("
call TO_DEC @totalsectors
filewrite browser " dec)\n"
fileread editor mediatype
filewrite browser "Media type: \t\t\t'",mediatype,"'\n"
fileread editor sectperfat
filewrite browser "Sectors per FAT (small volume): '",sectperfat,"' ("
call TO_DEC @sectperfat
filewrite browser " dec)\n"
fileread editor sectpertrack
filewrite browser "Sectors per track: \t\t'",sectpertrack,"' ("
call TO_DEC @sectpertrack
filewrite browser " dec)\n"
fileread editor numheads
filewrite browser "Number of heads: \t\t'",numheads,"' ("
call TO_DEC @numheads
filewrite browser " dec)\n"
fileread editor hiddensect
filewrite browser "Hidden sectors: \t\t'",hiddensect,"' ("
call TO_DEC @hiddensect
filewrite browser " dec)\n"
fileread editor bigtotalsect
filewrite browser "Large sectors: \t\t'",bigtotalsect,"' ("
call TO_DEC @bigtotalsect
filewrite browser " dec)\n"
fileread editor bigsectperfat
filewrite browser "Sectors per FAT: \t\t'",bigsectperfat,"' ("
call TO_DEC @bigsectperfat
filewrite browser " dec)\n"
fileread editor extflags
filewrite browser "Flags: \t\t\t'",extflags,"'\n"
fileread editor fsver
filewrite browser "Filesystem version: \t\t'",fsver,"' ("
call TO_DEC @fsver
filewrite browser " dec)\n"
fileread editor rootdirstartclus
filewrite browser "Root dir 1st cluster: \t\t'",rootdirstartclus,"' ("
call TO_DEC @rootdirstartclus
filewrite browser " dec)\n"
fileread editor fsinfosec
filewrite browser "FSInfo sector: \t\t'",fsinfosec,"' ("
call TO_DEC @fsinfosec
filewrite browser " dec)\n"
fileread editor backbootsect
filewrite browser "Backup boot sector: \t\t'",backbootsect,"' ("
call TO_DEC @backbootsect
filewrite browser " dec)\n"
fileread editor res1
fileread editor res2
=filewrite browser "Reserved: \t\t\t'",res1
=NUMBER_PREFIX=''
=filewrite browser res2,"'\n"
=NUMBER_PREFIX='0x'
fileread editor biosdrive
filewrite browser "Drive number: \t\t\t'",biosdrive,"'\n"
fileread editor unused
fileread editor signature
filewrite browser "NT Signature: \t\t\t'",signature,"'\n"
fileread editor volsn
filewrite browser "Volume serial number: \t\t'",volsn,"' ("
call TO_DEC @volsn
filewrite browser " dec)\n"
fileread editor volumelabel 11
filewrite browser "Volume label: \t\t\t'",volumelabel,"'\n"
fileread editor sysid 8
filewrite browser "System ID: \t\t\t'",sysid,"'\n"
end
= decimal output - taken from BMP viewer
@@TO_DEC
number_radix = 10
number_prefix = ''
var _r1 varref
pop _r1
filewrite browser deref(_r1)
number_prefix = '0x'
number_radix = 16
return